
/*
 *
 * Copyright (C) 2008 Mattias Blomqvist, patr-blo at dsv dot su dot se
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 */

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using System.IO;

namespace ClientExample.Guide.Storage
{
    public partial class StorageView : Form
    {
        public StorageView()
        {
            InitializeComponent();
        }

        private void StorageView_Load(object sender, EventArgs e)
        {
            System.IO.DriveInfo[] drivs = System.IO.DriveInfo.GetDrives();
            for (int i = 0; i < drivs.Length; i++)
            {
                if (drivs[i].IsReady)
                {
                    if (hardDriveInfo1.DriveInfo == null)
                    {
                        hardDriveInfo1.DriveInfo = drivs[i];
                        hardDriveInfo1.Visible = true;
                    }
                    else if (hardDriveInfo2.DriveInfo == null)
                    {
                        hardDriveInfo2.DriveInfo = drivs[i];
                        hardDriveInfo2.Visible = true;
                    }
                    else if (hardDriveInfo3.DriveInfo == null)
                    {
                        hardDriveInfo3.DriveInfo = drivs[i];
                        hardDriveInfo3.Visible = true;
                    }
                    else if (hardDriveInfo4.DriveInfo == null)
                    {
                        hardDriveInfo4.DriveInfo = drivs[i];
                        hardDriveInfo4.Visible = true;
                    }
                    else if (hardDriveInfo5.DriveInfo == null)
                    {
                        hardDriveInfo5.DriveInfo = drivs[i];
                        hardDriveInfo5.Visible = true;
                    }
                    else if (hardDriveInfo6.DriveInfo == null)
                    {
                        hardDriveInfo6.DriveInfo = drivs[i];
                        hardDriveInfo6.Visible = true;
                    }
                    else if (hardDriveInfo7.DriveInfo == null)
                    {
                        hardDriveInfo7.DriveInfo = drivs[i];
                        hardDriveInfo7.Visible = true;
                    }
                    else if (hardDriveInfo8.DriveInfo == null)
                    {
                        hardDriveInfo8.DriveInfo = drivs[i];
                        hardDriveInfo8.Visible = true;
                    }
                }
            }
                //if (drive.IsReady && hardDriveInfo1.DriveInfo == null)
                //    hardDriveInfo1.DriveInfo = drive;
                //if (drive.DriveType == System.IO.DriveType.Fixed)
                //{

                //}
        }
    }
}
